<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Gloze: union</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Gloze
   &#160;<span id="projectnumber">1.01-beta2</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="components.html">Schema Components</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">union </div>  </div>
</div>
<div class="contents">
<div class="textblock"><p>Union datatypes merge the lexical spaces of several existing types to create another. Because OWL does not currently support user-defined datatypes, <a class="el" href="classcom_1_1hp_1_1gloze_1_1_gloze.html">Gloze</a> uses only the union member types to define datatyped literals.</p>
<div class="fragment"><pre class="fragment">&lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;UTF-8&quot;</span>?&gt;
&lt;<span class="keyword">union </span>xmlns=<span class="stringliteral">&quot;http://example.org/&quot;</span>&gt;foobar&lt;/<span class="keyword">union</span>&gt;

</pre></div><p>This XML conforms to the schema below. The content is either an xs:int or an xs:string.</p>
<div class="fragment"><pre class="fragment">&lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;UTF-8&quot;</span>?&gt;
&lt;xs:schema xmlns:xs=<span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> targetNamespace=<span class="stringliteral">&quot;http://example.org/&quot;</span>&gt;
        
        &lt;xs:element name=<span class="stringliteral">&quot;union&quot;</span>&gt;
                &lt;xs:simpleType&gt;
                        &lt;xs:<span class="keyword">union </span>memberTypes=<span class="stringliteral">&quot;xs:int xs:string&quot;</span> /&gt;
                &lt;/xs:simpleType&gt;
        &lt;/xs:element&gt;
        
&lt;/xs:schema&gt;
</pre></div><p>The XML content is validated against both xs:int and xs:string to determine its type. In this case it is an xs:string.</p>
<div class="fragment"><pre class="fragment">@prefix ns2:     &lt;http:<span class="comment">//example.org/&gt; .</span>
@prefix ns1:     &lt;http:<span class="comment">//example.org/def/&gt; .</span>
@prefix xs_:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix rdf:     &lt;http:<span class="comment">//www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .</span>
@prefix xs:      &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema&gt; .</span>

&lt;http:<span class="comment">//example.org/union.xml&gt;</span>
      ns2:<span class="keyword">union </span>&quot;foobar&quot; .
</pre></div><p>There's little to say about the range of the property. A simple type may sometimes map to an object type (e.g. QNames), so a union is not necessarily a datatype property. In this case, both member types map to datatype properties so 'union' is a datatype property.</p>
<div class="fragment"><pre class="fragment">@prefix ns2:     &lt;http:<span class="comment">//example.org/&gt; .</span>
@prefix rdfs:    &lt;http:<span class="comment">//www.w3.org/2000/01/rdf-schema#&gt; .</span>
@prefix ns1:     &lt;http:<span class="comment">//example.org/def/&gt; .</span>
@prefix xs_:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix owl:     &lt;http:<span class="comment">//www.w3.org/2002/07/owl#&gt; .</span>
@prefix xsd:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix rdf:     &lt;http:<span class="comment">//www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .</span>
@prefix xs:      &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema&gt; .</span>

&lt;http:<span class="comment">//example.org/union.owl&gt;</span>
      a       owl:Ontology .

ns2:<span class="keyword">union</span>
      a       rdf:Property , owl:DatatypeProperty ;
      rdfs:range
              [ a       owl:Class ;
                owl:unionOf (xsd:<span class="keywordtype">string</span> xsd:<span class="keywordtype">int</span>)
              ] .
</pre></div><h2><a class="anchor" id="unionChildren"></a>
Child components</h2>
<ul>
<li><a class="el" href="annotation.html">annotation</a></li>
<li><a class="el" href="simple_type.html">simpleType</a> </li>
</ul>
</div></div>


<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 15 2011 22:13:50 for Gloze by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
